package com.cheng.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cheng.common.exception.CommonException;
import com.cheng.common.utils.StringUtil;
import com.cheng.data.entity.ArchiveTypeInfEntity;
import com.cheng.data.mapper.ArchiveTypeInfMapper;
import com.cheng.service.ArchiveTypeInfService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: ChengJW
 * @date: 2021/11/8 19:43
 * @version: 1.0
 * @description: 档案类型信息 archive_type_inf
 */
@Service
public class ArchiveTypeInfServiceImpl implements ArchiveTypeInfService {

    private final static Logger log = LoggerFactory.getLogger(ArchiveTypeInfServiceImpl.class);

    @Autowired
    private ArchiveTypeInfMapper archiveTypeInfMapper;

    /**
     * @author: ChengJW
     * @params: []
     * @return: java.util.List<com.cheng.data.entity.ArchiveTypeInfEntity>
     * @date: 2021/11/8
     * @description: 查询 archive_type_inf 信息
     */
    @Override
    public List<ArchiveTypeInfEntity> queryArchiveTypeInf(ArchiveTypeInfEntity entity) throws CommonException {

        QueryWrapper<ArchiveTypeInfEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtil.isNotNull(entity.getArTypeCode()),"ar_type_code",entity.getArTypeCode());
        return archiveTypeInfMapper.selectList(wrapper);
    }
}
